package com.power.project.dao;

import com.power.project.model.Ww_usertag;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;

import java.io.Serializable;

/**
 *  持久层(hibernate)
 */

public interface Ww_usertagDao extends JpaRepository<Ww_usertag, Serializable>, JpaSpecificationExecutor<Ww_usertag>, Repository<Ww_usertag, Serializable>, Ww_usertagDaoCustom<Ww_usertag, Serializable> {


   @org.springframework.transaction.annotation.Transactional
   @Modifying
   @Query("delete from Ww_usertag w where w.tagid = ?1 and w.tenantid = ?2")
   void deleteByTagIdAndTenantId(String tagId, String tenantId);

   @org.springframework.transaction.annotation.Transactional
   @Modifying
   @Query("delete from Ww_usertag w where w.wwuserid = ?1 and w.tenantid = ?2")
   void deleteByUserIdAndTenantId(String userId, String tenantId);


}
